<template>
	<view>
		<view class="padding-xl text-center text999" v-if="!list.length">
			您暂时还没有订单哦~
		</view>
		<view class="margin radius10 padding-xs" style="background-color: #E0F1FF;" v-for="(item,index) in list"
			:key="index">
			<view class="padding flex align-center text-lg text-bold padding-top-lg">
				<view class="flex-sub text-lg text-bold">
					订单{{index+1}}
				</view>
				<view class="" :class="item.is_pay==1?'text-blue':'text-red'">
					{{item.is_pay==1?'已支付':'未支付'}}
				</view>
			</view>
			<view class="padding bg-white radius10">
				<view class="text666 margin-bottom-sm">
					订单编号: {{item.order_no}}
				</view>
				<view class="text666 margin-bottom-sm" v-if="item.pay_time">
					支付时间: {{item.pay_time}}
				</view>
				<view class="text666 margin-bottom-sm">
					订购区域: {{item.area}}
				</view>
				<view class="text666 margin-bottom-sm">
					订购小学: {{item.school_name}}
				</view>
				<view class="text666 margin-bottom-sm">
					订购班级: {{item.grades_classs}}
				</view>
				<view class="text666 margin-bottom-sm">
					订购姓名: {{item.student_name}}
				</view>
				<view v-for="(i,ind) in item.details" :key="ind"
					class="padding-top margin-top bor-t-E5 flex align-center">
					<image :src="i.goods_image" mode="aspectFill" style="width: 200upx;height: 150upx;">
					</image>
					<view class="flex-sub margin-left">
						<view class="text666">
							{{i.goods_name}}
						</view>
						<view class="margin-top-sm text666 text-sm">
							{{i.specifications}}
						</view>
						<view class="margin-top-sm flex align-end">
							<view class="flex-sub">
								¥{{i.price}}
							</view>
							<view class="text999">
								x{{i.num}}
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page: 1,
				list: []
			}
		},
		onLoad() {
			this.getList();
		},
		onReachBottom() {
			this.getList();
		},
		methods: {
			getList() {
				this.util.request('/order/lists', {
					page: this.page,
					limit: 10
				}).then(res => {
					this.list = this.list.concat(res.list);
					this.page++;
				})
			}
		}
	}
</script>

<style>

</style>